# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

from wlmodels.codes.dicts import cd16_dict, ca22_dict, ca24_dict, ca41_dict, cz07_dict, cz08_dict, ex06_dict, cc02_dict
from wlmodels.codes.fields import CrossForeignCharField
from wlmodels.codes.models import ELBaseModel, ELRegion, ELCA02, ELCA04, ELCA11, ELCA16, EntIdable


# 注销信息
class ELCancel(ELBaseModel):
    entobj = models.ForeignKey('company.ELPost', verbose_name='所属企业', db_column='entid', default=0,
                               related_name='c_cancel', to_field='entid')
    CANREA = models.CharField('注销原因', max_length=3, null=True, blank=True, choices=cd16_dict, db_index=True)
    CANDATE = models.DateField('注销日期', null=True, blank=True)
    CANAUTH = models.CharField('注销机关', max_length=100, null=True, blank=True)
    SANDOCNO = models.CharField('批准文号', max_length=50, null=True, blank=True)
    PUBNEWSNAME = models.CharField('公告报纸名称', max_length=100, null=True, blank=True)
    PUBDATE = models.DateField('公告日期', null=True, blank=True)
    EXTCLEBRSIGN = models.CharField('对外投资清理完毕标志', max_length=1, null=True, blank=True, choices=ex06_dict)
    CANCELBRSIGN = models.CharField('非法人分支机构注销完毕标志', max_length=1, null=True, blank=True, choices=ex06_dict)
    DECLEBRSIGN = models.CharField('债权债券清理情况完结标志', max_length=1, null=True, blank=True, choices=ex06_dict)
    AFFWRITNO = models.CharField('清算组成员备案确认文书编号', max_length=50, null=True, blank=True)
    BLICREVORINUM = models.IntegerField('营业执照缴销正本数', null=True, blank=True)
    BLICREVORINO = models.CharField('营业执照缴销正本编号', max_length=36, null=True, blank=True)
    BLICREVDUPCONUM = models.IntegerField('营业执照缴销副本数', null=True, blank=True)
    CAREVNUM = models.IntegerField('公章缴销枚数', null=True, blank=True)
    CAREVST = models.TextField('公章缴销情况', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '企业注销销信息'
        verbose_name_plural = '企业注销信息'
        app_label = "company"
        db_table = 'company_cancel'

    def _entid(self):
        from wlmodels.company.models import ELPost
        entid = ELPost.objects.filter(entid=self.entobj_id).first()
        if entid:
            return entid
        return ""

    _entid.short_description = "所属企业"

    entid = property(_entid)

    def __unicode__(self):
        return u'%s的注销信息' % self.entid


# 吊销信息
class ELRevoke(ELBaseModel):
    entobj = models.ForeignKey('company.ELPost', verbose_name='所属企业', db_column='entid', default=0,
                               related_name='c_revoke', to_field='entid')
    REVDATE = models.DateField('吊销日期', null=True, blank=True)
    ILLEGACT = models.TextField('违法行为', null=True, blank=True)
    REVBASIS = models.TextField('吊销依据', null=True, blank=True)
    ISCAN = models.NullBooleanField('是否注销', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '企业吊销信息'
        verbose_name_plural = '企业吊销信息'
        app_label = "company"
        db_table = 'company_revoke'

    def _entid(self):
        from wlmodels.company.models import ELPost
        entid = ELPost.objects.filter(entid=self.entobj_id).first()
        if entid:
            return entid
        return ""

    _entid.short_description = "所属企业"

    entid = property(_entid)

    def __unicode__(self):
        return u'%s的吊销信息' % self.entid


# 迁入信息
class ELMoveIn(EntIdable):
    MIN_ID = models.CharField('迁入ID', max_length=50, null=True, blank=True)
    MINLETNUM = models.CharField('迁入函号', max_length=50, null=True, blank=True)
    MOUTAREA = models.TextField('迁出地区', null=True, blank=True)
    MINREA = models.TextField('迁入原因', null=True, blank=True)
    MOUTAREREGORG_id = CrossForeignCharField('迁出登记机关', db_column='MOUTAREREGORG', max_length=8, null=True, blank=True)
    MINDATE = models.DateField('迁入日期', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '迁入信息'
        verbose_name_plural = '迁入信息'
        app_label = "companyplus"
        db_table = 'company_move_in'

    def __unicode__(self):
        return u'%s的迁入信息' % self.entid

    def _moutregorg(self):
        the_moutregorg = list(ELCA11.objects.filter(code=self.MOUTAREREGORGREGORG_id).values_list("name", flat=True))
        if len(the_moutregorg):
            return the_moutregorg[0]
        return ""

    _moutregorg.short_description = "迁出登记机关"

    MOUTAREREGORG = property(_moutregorg)


# 迁出信息
class ELMoveOut(EntIdable):
    MOUT_ID = models.CharField('迁出ID', max_length=50, null=True, blank=True)
    MOUTLETNUM = models.CharField('迁出函号', max_length=50, null=True, blank=True)
    MINAREA = models.TextField('迁入地区', null=True, blank=True)
    MOUTREA = models.TextField('迁出原因', null=True, blank=True)
    MINAREREGORG_id = CrossForeignCharField('迁入登记机关', db_column='MINAREREGORG', max_length=8, null=True, blank=True)
    MOUTDATE = models.DateField('迁出日期', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '迁出信息'
        verbose_name_plural = '迁出信息'
        app_label = "companyplus"
        db_table = 'company_move_out'

    def __unicode__(self):
        return u'%s的迁出信息' % self.entid

    def _minregorg(self):
        the_minregorg = list(ELCA11.objects.filter(code=self.MINAREREGORG_id).values_list("name", flat=True))
        if len(the_minregorg):
            return the_minregorg[0]
        return ""

    _minregorg.short_description = "迁入登记机关"

    MINAREREGORG = property(_minregorg)


# 企业名称信息表
class ELRegName(EntIdable):
    PRIPID = models.CharField('中数UID', max_length=36, null=True, blank=True, db_index=True)
    NAME_ID = models.CharField('名称ID', max_length=50, null=True, blank=True, db_index=True)
    ENTNAME = models.CharField('企业名称', max_length=100, null=True, blank=True, db_index=True)
    NAMEDISTRICT_id = CrossForeignCharField('名称行政区域', max_length=6, null=True, blank=True, db_column='NAMEDISTRICT')
    ENTTRA = models.CharField('企业(机构)字号', max_length=40, null=True, blank=True)
    NAMEIND = models.CharField('名称行业', max_length=36, null=True, blank=True)
    ORGFORM = models.CharField('组织形式', max_length=30, null=True, blank=True)
    TRADPINY = models.CharField('字号拼音', max_length=60, null=True, blank=True)
    GRPSHFORM = models.CharField('集团简称', max_length=100, null=True, blank=True)
    SAVEDPERTO = models.DateField('保留期至', null=True, blank=True)
    APPRNO = models.CharField('核准文号', max_length=100, null=True, blank=True)
    APPRAUTH_id = CrossForeignCharField('核准机关', max_length=8, null=True, blank=True, db_column='APPRAUTH')
    PREREGORG_id = CrossForeignCharField('规定登记机关', max_length=8, null=True, blank=True, db_column='PREREGORG')
    APPRDATE = models.DateField('核准日期', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '名称审核信息'
        verbose_name_plural = '名称审核信息'
        app_label = "companyplus"
        db_table = 'company_reg_name'

    def __unicode__(self):
        return u'%s的名称审核信息' % self.entid

    def _namedistrict(self):
        return ELRegion.get_region(self.NAMEDISTRICT_id)

    _namedistrict.short_description = "名称行政区域"

    NAMEDISTRICT = property(_namedistrict)

    def _apprauth(self):
        the_apprauth = list(ELCA11.objects.filter(code=self.APPRAUTH_id).values_list("name", flat=True))
        if len(the_apprauth):
            return the_apprauth[0]
        return ""

    _apprauth.short_description = "核准机关"

    APPRAUTH = property(_apprauth)

    def _preregorg(self):
        the_preregorg = list(ELCA11.objects.filter(code=self.PREREGORG_id).values_list("name", flat=True))
        if len(the_preregorg):
            return the_preregorg[0]
        return ""

    _preregorg.short_description = "规定登记机关"

    PREREGORG = property(_preregorg)


# 名称禁用信息
class ELRegNameBanInfo(ELBaseModel):
    BAN_ID = models.CharField('禁用ID', max_length=50, db_index=True)
    BANLETTER = models.CharField('禁用文字', max_length=200, null=True, blank=True)
    BANLETTPINY = models.CharField('禁用文字拼音', max_length=200, null=True, blank=True)
    BANTYPE = models.CharField('禁用类型', max_length=2, null=True, blank=True, choices=ca41_dict)
    BANEXP = models.TextField('禁用说明', null=True, blank=True)
    BANFORM = models.DateField('禁用起始日期', null=True, blank=True)
    BANTO = models.DateField('禁用解除日期', null=True, blank=True)
    RECPER = models.CharField('备案人', max_length=200, null=True, blank=True)
    RECDATE = models.DateField('备案日期', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '名称禁用信息'
        verbose_name_plural = '名称禁用信息'
        app_label = "companyplus"
        db_table = 'company_reg_name_baninfo'

    def __unicode__(self):
        return u'名称禁用信息%s' % self.id


# 名称争议信息
class ELRegNameDissension(ELBaseModel):
    DIS_ID = models.CharField('争议ID', max_length=50, db_index=True)
    APPEDATE = models.DateField('投诉日期', null=True, blank=True)
    APP1 = models.CharField('请求人', max_length=100, null=True, blank=True)
    RES = models.CharField('被请求人', max_length=200, null=True, blank=True)
    DISST = models.TextField('争议情况', null=True, blank=True)
    DISSETRES = models.TextField('争议处理结果', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '名称争议信息'
        verbose_name_plural = '名称争议信息'
        app_label = "companyplus"
        db_table = 'company_reg_name_dissension'

    def __unicode__(self):
        return u'名称争议信息%s' % self.id


# 名称预先核准时拟设企业基本信息表
class ELRegPre(EntIdable):
    PRIPID = models.CharField('中数UID', max_length=36, null=True, blank=True, db_index=True)
    NAME_ID = models.CharField('名称ID', max_length=50, null=True, blank=True, db_index=True)
    ENTTYPE_id = CrossForeignCharField('企业(机构)类型', db_column='ENTTYPE', max_length=4, null=True, blank=True)
    DOMDISTRICT_id = CrossForeignCharField('住所所在行政区划', db_column='DOMDISTRICT', max_length=6, null=True, blank=True)
    OPLOCDISTRICT_id = CrossForeignCharField('经营场所所在行政区划', db_column='OPLOCDISTRICT', max_length=6, null=True, blank=True)
    CONGRO = models.FloatField('投资总额', null=True, blank=True)
    CONGROCUR_id = CrossForeignCharField('投资总额币种', max_length=3, null=True, blank=True, db_column='CONGROCUR')
    CONGROUSD = models.FloatField('投资总额折万美元', null=True, blank=True)
    REGCAP = models.FloatField('注册资本(金)', null=True, blank=True)
    REGCAPCUR_id = CrossForeignCharField('注册资本(金)币种', max_length=3, null=True, blank=True, db_column='REGCAPCUR')
    REGCAPUSD = models.FloatField('注册资本(金)折万美元', null=True, blank=True)
    FORSUBCONAMUSD = models.FloatField('外方认缴出资额折万美元', null=True, blank=True)
    OPSCOPE = models.TextField('经营(业务)范围', null=True, blank=True)
    INDUSTRYCO = models.CharField('行业代码', max_length=4, null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '预设基本信息'
        verbose_name_plural = '预设基本信息'
        app_label = "companyplus"
        db_table = 'company_reg_pre'

    def __unicode__(self):
        return u'%s的预设基本信息' % self.entid

    def _enttype(self):
        the_enttype = list(ELCA16.objects.filter(code=self.ENTTYPE_id).values_list("name", flat=True))
        if len(the_enttype):
            return the_enttype[0]
        return ""

    _enttype.short_description = "企业(机构)类型"

    ENTTYPE = property(_enttype)

    def _domdistrict(self):
        return ELRegion.get_region(self.DOMDISTRICT_id)

    _domdistrict.short_description = "住所所在行政区划"

    DOMDISTRICT = property(_domdistrict)

    def _oplocdistrict(self):
        return ELRegion.get_region(self.OPLOCDISTRICT_id)

    _oplocdistrict.short_description = "经营场所所在行政区划"

    OPLOCDISTRICT = property(_oplocdistrict)

    def _congrocur(self):
        the_congrocur = list(ELCA04.objects.filter(code=self.CONGROCUR_id).values_list("name", flat=True))
        if len(the_congrocur):
            return the_congrocur[0]
        return ""

    _congrocur.short_description = "投资总额币种"

    CONGROCUR = property(_congrocur)

    def _regcapcur(self):
        the_regcapcur = list(ELCA04.objects.filter(code=self.REGCAPCUR_id).values_list("name", flat=True))
        if len(the_regcapcur):
            return the_regcapcur[0]
        return ""

    _regcapcur.short_description = "注册资本(金)币种"

    REGCAPCUR = property(_regcapcur)


# 名称预先核准时拟设企业投资人信息
class ELRegPreInv(ELBaseModel):
    NAME_ID = models.CharField('名称ID', max_length=50, db_index=True)
    INVID = models.CharField('投资人身份标识', max_length=50, null=True, blank=True)
    INV = models.CharField('投资人', max_length=150, null=True, blank=True)
    INVTYPE = models.CharField('投资人类型', max_length=2, null=True, blank=True, choices=ca24_dict)
    CERNO = models.CharField('证件号码', max_length=30, null=True, blank=True, db_index=True)
    CERTTPE = models.CharField('证件类型', max_length=2, null=True, blank=True)
    COUNTRY_id = CrossForeignCharField('国别(地区)', max_length=3, null=True, blank=True, db_column='COUNTRY')
    SCONFORM = models.CharField('出资方式', max_length=2, null=True, blank=True, choices=ca22_dict)
    SUBCONAM = models.DecimalField('认缴出资额', max_digits=15, decimal_places=2, null=True, blank=True)
    SUBCONAMUSD = models.DecimalField('认缴额折万美元', max_digits=15, decimal_places=2, null=True, blank=True)
    CONPROP = models.FloatField('出资比例', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '预核投资人信息'
        verbose_name_plural = '预核投资人信息'
        app_label = "companyplus"
        db_table = 'company_reg_pre_inv'

    def __unicode__(self):
        return u'预核投资人信息%s' % self.id

    def _country(self):
        the_country = list(ELCA02.objects.filter(code=self.COUNTRY_id).values_list("name", flat=True))
        if len(the_country):
            return the_country[0]
        return ""

    _country.short_description = "国别(地区)"

    COUNTRY = property(_country)


# 外商投资企业资金信息表
class ELRegFormoney(EntIdable):
    CONGRO = models.FloatField('投资总额（万）', null=True, blank=True)
    CONGROCUR_id = CrossForeignCharField('投资总额币种', max_length=3, null=True, blank=True, db_column='CONGROCUR')
    CONGROUSD = models.FloatField('投资总额折万美元', null=True, blank=True)
    REGCAP = models.FloatField('注册资本(金，万)', null=True, blank=True)
    REGCAPCUR_id = CrossForeignCharField('注册资本(金)币种', max_length=3, null=True, blank=True, db_column='REGCAPCUR')
    REGCAPUSD = models.FloatField('注册资本(金)折万美元', null=True, blank=True)
    REGCAPRMB = models.FloatField('注册资本(金)折人民币', null=True, blank=True)
    RECCAP = models.FloatField('实收资本', null=True, blank=True)
    RECCAPCUR_id = CrossForeignCharField('实收资本币种', max_length=3, null=True, blank=True, db_column='RECCAPCUR')
    RECCAPUSD = models.FloatField('实收资本折万美元', null=True, blank=True)
    RECCAPRMB = models.FloatField('实收资本折人民币', null=True, blank=True)
    DOMEREGCAP = models.FloatField('中方注册资本(金)', null=True, blank=True)
    DOMEREGCAPCUR_id = CrossForeignCharField('中方注册资本币种', max_length=3, null=True, blank=True, db_column='DOMEREGCAPCUR')
    DOMEREGCAPUSD = models.FloatField('中方注册资本(金)折万美元', null=True, blank=True)
    DOMEREGCAPINVPROP = models.FloatField('中方注册资本(金)出资比例', null=True, blank=True)
    DOMERECCAP = models.FloatField('中方实收资本', null=True, blank=True)
    DOMERECCAPCUR_id = CrossForeignCharField('中方实收资本币种', max_length=3, null=True, blank=True, db_column='DOMERECCAPCUR')
    DOMERECCAPUSD = models.FloatField('中方实收资本折万美元', null=True, blank=True)
    DOMERECCAPCONPROP = models.FloatField('中方实收资本出资比例', null=True, blank=True)
    FORREGCAP = models.FloatField('外方注册资本(金)', null=True, blank=True)
    FORREGCAPCUR_id = CrossForeignCharField('外方注册资本币种', max_length=3, null=True, blank=True, db_column='FORREGCAPCUR')
    FORREGCAPUSD = models.FloatField('外方注册资本(金)折万美元', null=True, blank=True)
    FORRRGCAPINVPROP = models.FloatField('外方注册资本(金)出资比例', null=True, blank=True)
    FORRECCAP = models.FloatField('外方实收资本', null=True, blank=True)
    FORRECCAPCUR_id = CrossForeignCharField('外方实收资本币种', max_length=3, null=True, blank=True, db_column='FORRECCAPCUR')
    FORRECCAPUSD = models.FloatField('外方实收资本折万美元', null=True, blank=True)
    FORRECCAPCONPROP = models.FloatField('外方实收资本出资比例', null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '外商投资信息'
        verbose_name_plural = '外商投资信息'
        app_label = "companyplus"
        db_table = 'company_reg_formoney'

    def __unicode__(self):
        return u'%s的外商投资' % self.entid

    def _congrocur(self):
        the_congrocur = list(ELCA04.objects.filter(code=self.CONGROCUR_id).values_list("name", flat=True))
        if len(the_congrocur):
            return the_congrocur[0]
        return ""

    _congrocur.short_description = "投资总额币种"

    CONGROCUR = property(_congrocur)

    def _regcapcur(self):
        the_regcapcur = list(ELCA04.objects.filter(code=self.REGCAPCUR_id).values_list("name", flat=True))
        if len(the_regcapcur):
            return the_regcapcur[0]
        return ""

    _regcapcur.short_description = "注册资本(金)币种"

    REGCAPCUR = property(_regcapcur)

    def _reccapcur(self):
        the_reccapcur = list(ELCA04.objects.filter(code=self.RECCAPCUR_id).values_list("name", flat=True))
        if len(the_reccapcur):
            return the_reccapcur[0]
        return ""

    _reccapcur.short_description = "实收资本币种"

    RECCAPCUR = property(_reccapcur)

    def _domeregcapcur(self):
        the_domeregcapcur = list(ELCA04.objects.filter(code=self.DOMEREGCAPCUR_id).values_list("name", flat=True))
        if len(the_domeregcapcur):
            return the_domeregcapcur[0]
        return ""

    _domeregcapcur.short_description = "中方注册资本币种"

    DOMEREGCAPCUR = property(_domeregcapcur)

    def _domereccapcur(self):
        the_domereccapcur = list(ELCA04.objects.filter(code=self.DOMERECCAPCUR_id).values_list("name", flat=True))
        if len(the_domereccapcur):
            return the_domereccapcur[0]
        return ""

    _domereccapcur.short_description = "中方实收资本币种"

    DOMERECCAPCUR = property(_domereccapcur)

    def _forregcapcur(self):
        the_forregcapcur = list(ELCA04.objects.filter(code=self.FORREGCAPCUR_id).values_list("name", flat=True))
        if len(the_forregcapcur):
            return the_forregcapcur[0]
        return ""

    _forregcapcur.short_description = "外方注册资本币种"

    FORREGCAPCUR = property(_forregcapcur)

    def _forreccapcur(self):
        the_forreccapcur = list(ELCA04.objects.filter(code=self.FORRECCAPCUR_id).values_list("name", flat=True))
        if len(the_forreccapcur):
            return the_forreccapcur[0]
        return ""

    _forreccapcur.short_description = "外方实收资本币种"

    FORRECCAPCUR = property(_forreccapcur)


# 涉网信息
class ELWadenet(EntIdable):
    WADENETINFOID = models.CharField('唯一标识', max_length=50, null=True, blank=True)
    WEBSITNAME = models.CharField('网站或网店名称', max_length=100, null=True, blank=True)
    TYPOFWEB = models.CharField('网站或网店类型', max_length=4, null=True, blank=True, choices=cz07_dict)
    DOMAIN = models.CharField('网站或网店域名（链接网址）', max_length=255, null=True, blank=True)
    WEBECOMMTYP = models.CharField('网站电子商务类型', max_length=2, null=True, blank=True, choices=cz08_dict)
    IPADDRESS = models.CharField('IP地址', max_length=255, null=True, blank=True)
    PHYADDOFSER = models.CharField('网站服务器国内物理位置', max_length=255, null=True, blank=True)
    PHYADDOFSERFOR = models.CharField('网站服务器国外物理位置', max_length=255, null=True, blank=True)
    NAMOFHOSPLAT = models.CharField('网店所在网络交易平台名称', max_length=100, null=True, blank=True)
    TYPEOFIDEN = models.CharField('标识类型', max_length=2, null=True, blank=True, choices=(('1', '电子标识'), ('2', '营业执照电子副本')))
    GIVEELEIDEN = models.CharField('是否发放电子标识', max_length=1, null=True, blank=True, choices=(('1', '是'), ('2', '否')))
    REMARK = models.CharField('备注', max_length=255, null=True, blank=True)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '涉网信息'
        verbose_name_plural = '涉网信息'
        app_label = "companyplus"
        db_table = 'company_wm_wadenet'

    def __unicode__(self):
        return u'涉网信息-%s' % self.id


# 驰名商标情况
class ELBrand(EntIdable):
    TMNAME = models.CharField('商标名称', max_length=200, null=True)
    TMREGNO = models.CharField('商标注册证号', max_length=20, null=True, blank=True)
    COGDATE = models.DateField('认定日期', null=True, blank=True)
    COGGOS = models.TextField('认定商品/服务', null=True, blank=True)
    COGAUTH = models.CharField('认定单位', max_length=100, null=True, blank=True)
    TMHOLDER = models.CharField('商标所有人', max_length=200, null=True, blank=True)
    TMTYPE_id = CrossForeignCharField('商标类型', db_column='TMTYPE', max_length=6, null=True, blank=True)
    APPPROD = models.CharField('适用产品', max_length=200, null=True, blank=True)
    REGDATE = models.DateField('注册日期', null=True, blank=True)
    TMFROM = models.DateField('商标有效期自', null=True, blank=True)
    TMTO = models.DateField('商标有效期至', null=True, blank=True)
    RESFAMOUS = models.CharField('驰名/著名标识', max_length=4, null=True, blank=True, choices=cc02_dict)
    updated = models.DateTimeField('更新时间', null=True, blank=True)

    class Meta:
        verbose_name = '驰名商标'
        verbose_name_plural = '驰名商标'
        app_label = "companyplus"
        db_table = 'company_brand'

    def __unicode__(self):
        return u'驰名商标-%s' % self.id

    def _tmtype(self):
        the_tmtype = list(ELCA16.objects.filter(code=self.TMTYPE_id).values_list("name", flat=True))
        if len(the_tmtype):
            return the_tmtype[0]
        return ""

    _tmtype.short_description = "商标类型"

    TMTYPE = property(_tmtype)


models_registe_imported = 0  # 仅供主model引用的虚变量
